package iu.test;

import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import search.BubbleSort;

import java.util.Arrays;

/**
 * Created by Olga on 21.05.2014.
 */
public class BubbleTestProvider {
    @DataProvider
    public Object[][] inputDataTypes() {
        return new Object[][]{
                new Object[]{new int[]{2, 3, 1}, new int[]{3, 2, 1}},
                new Object[]{new int[]{2, 3, 1, 18}, new int[]{1, 2, 3, 18}},
                new Object[]{new int[]{2, 3, 1}, new int[]{1, 2, 3}}
        };
    }

    @Test(dataProvider = "inputDataTypes")
    public void binarySort(int[] source, int[] expected) {

        BubbleSort source1 = new BubbleSort();

        int[] array = source1.bubble(source);

        Assert.assertEquals(expected, array, "source: " + Arrays.toString(array) + ", expected: " + Arrays.toString(expected));
    }

}
